-
Notifications
You must be signed in to change notification settings - Fork 72
refactor: replace ConnectionService with ServiceUtility #1534
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…sterAwareWriterFailoverHandler
3e3ca46 to
c465a00
Compare
| } | ||
|
|
||
| protected FullServicesContainer getNewServicesContainer() throws SQLException { | ||
| return ServiceUtility.getInstance().createServiceContainer( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a suggestion. I've seen such piece of code at least twice. I think it makes sense to create a new method:
ServiceUtility.createNewFromSource(FullServicesContainer source, PluginService pluginService, Properties props)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it the same pluginService that is sitting in serviceContainer? Can we use
this.servicesContainer.getPluginService() instead?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good idea, thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added the requested method, I did however keep the "getNewServicesContainer" method because it allows me to mock the service container creation in our unit tests
wrapper/src/main/java/software/amazon/jdbc/util/ServiceUtility.java
Outdated
Show resolved
Hide resolved
wrapper/src/main/java/software/amazon/jdbc/util/ServiceUtility.java
Outdated
Show resolved
Hide resolved
| * {@link software.amazon.jdbc.util.ServiceUtility#createServiceContainer} followed by | ||
| * {@link PluginService#forceConnect} instead. | ||
| */ | ||
| @Deprecated |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We're going to release 3.0 with some breaking changes. Do we want to add one more breaking change and completely remove this interface and implementation class?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds like we will keep these changes as part of a minor version bump instead of a major one, but I agree we should remove this when we bump to 3.0
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.